#pragma once
#include "Geometry.h"
#include "ogr_core.h"

class CPointGeometry : public CGeometry
{
public:
	CPointGeometry();
	CPointGeometry(double x, double y);
	~CPointGeometry();
	void draw(CDrawer* pDrawer);
	OGRwkbGeometryType getGeometryType(){return OGRwkbGeometryType::wkbPoint;}
	double m_x;
	double m_y;
};

class CLineGeometry : public CGeometry
{
public:
	CLineGeometry();
	~CLineGeometry();
	void draw(CDrawer* pDrawer);
	OGRwkbGeometryType getGeometryType(){return OGRwkbGeometryType::wkbLineString;}
	void addPoint(CPointGeometry* pPoint);
private:
	CArray<CPointGeometry*> m_points;
};

class CLineRingGeometry : public CGeometry
{
public:
	CLineRingGeometry();
	~CLineRingGeometry();
	void draw(CDrawer* pDrawer);
	OGRwkbGeometryType getGeometryType(){return OGRwkbGeometryType::wkbLineString;}
	void addPoint(CPointGeometry* pPoint);
private:
	CArray<CPointGeometry*> m_points;
};

class CMultiLineGeometry : public CGeometry
{
public:
	CMultiLineGeometry();
	~CMultiLineGeometry();
	void draw(CDrawer* pDrawer);
	OGRwkbGeometryType getGeometryType(){return OGRwkbGeometryType::wkbMultiLineString;}
	void addLine(CLineGeometry* pLine);
private:
	CArray<CLineGeometry*> m_lines;
};

class CPolygonGeometry : public CGeometry
{
public:
	CPolygonGeometry();
	~CPolygonGeometry();
	void draw(CDrawer* pDrawer);
	void addLineRing(CLineRingGeometry* pLineRing);
	OGRwkbGeometryType getGeometryType(){return OGRwkbGeometryType::wkbPolygon;}
private:
	CArray<CLineRingGeometry*> m_lineRings;
};

class CMultiPolygonGeometry : public CGeometry
{
public:
	CMultiPolygonGeometry();
	~CMultiPolygonGeometry();
	void draw(CDrawer* pDrawer);
	void addPolygon(CPolygonGeometry* pPolygon);
	OGRwkbGeometryType getGeometryType(){return OGRwkbGeometryType::wkbMultiPolygon;}
private:
	CArray<CPolygonGeometry*> m_polygons;
};
